package com.plian.system.dao.ra.recordleasecontractsublia;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dao.DaoSupport;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class RecordLeaseContractSubliADao {
    @Resource(name = "daoSupport")
    private DaoSupport dao;

    /**
     * 批量新增
     *
     * @param list
     * @throws Exception
     */
    public void saveAll(List<PageData> list) throws Exception {
        dao.save("RecordLeaseContractSubliAMapper.saveAll", list);
    }

    /**
     * 通过父节点查找
     *
     * @param recordleasecontractId
     * @return
     * @throws Exception
     */
    public List<PageData> findById(String recordleasecontractId) throws Exception {
        return (List<PageData>) dao.findForList("RecordLeaseContractSubliAMapper.findById", recordleasecontractId);
    }

    /**
     * 通过父节点删除
     *
     * @param recordleasecontractId
     * @throws Exception
     */
    public void delByParent(String recordleasecontractId) throws Exception {
        dao.delete("RecordLeaseContractSubliAMapper.del_id", recordleasecontractId);
    }
}
